//
//  LocationServeManager.m
//  EasyToTesco2.0
//
//  Created by baozi on 16/8/22.
//  Copyright © 2016年 EasyToTesco. All rights reserved.
//

#import "LocationServeManager.h"

@implementation LocationServeManager

static LocationServeManager *_instance;
+ (instancetype)sharedLocationServeManager {
 
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _instance = [[self alloc] init];
        
        if ([_instance respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
            [_instance requestWhenInUseAuthorization];
            [_instance requestAlwaysAuthorization];
        }
        
        [_instance setDesiredAccuracy:kCLLocationAccuracyBest];
        
        [_instance setDistanceFilter:100];
        
    });
    
    return _instance;
}

- (void)start {
    [_instance startUpdatingLocation];
    
    [_instance startUpdatingHeading];
}

- (void)stop {
    [_instance stopUpdatingLocation];
    
}

@end
